package com.project.biz;

import com.baomidou.mybatisplus.extension.service.IService;
import com.project.entity.CmsShoppingCart;
import com.project.pojo.dto.UserShoppingCartDTO;
import com.project.pojo.model.AddShoppingCartModel;
import com.project.pojo.model.DelShoppingCartModel;
import com.project.pojo.model.UpdateShoppingCartCountModel;
import com.project.pojo.model.UpdateShoppingCartSkuModel;

/**
 * @Description: 购物车业务层接口类
 * @Author: zhuchi
 * @CreateDate: 2020/10/15 22:41
 * @Version: 1.0
 */
public interface CmsShoppingCartBiz extends IService<CmsShoppingCart> {

    /**
     * 添加购物车
     * @param addShoppingCartModel
     * @param userId
     * @return
     */
    int addShoppingCart(AddShoppingCartModel addShoppingCartModel, Long userId);

    /**
     * 验证用户是否加入过相同商品,相同规格,如果加入过时再添加只更新数量
     * @param productId
     * @param skuId
     * @param userId
     * @return
     */
    CmsShoppingCart selectShoppingCartByProductId(Long productId, Long skuId, Long userId);

    /**
     * 修改购物车商品规格
     * @param updateShoppingCartSkuModel
     * @return
     */
    int updateShoppingCartSku(UpdateShoppingCartSkuModel updateShoppingCartSkuModel);

    /**
     * 修改购物车商品数量
     * @param updateShoppingCartCountModel
     * @return
     */
    int updateShoppingCartCount(UpdateShoppingCartCountModel updateShoppingCartCountModel);

    /**
     * 获取购物车信息
     * @param userId
     * @return
     */
    UserShoppingCartDTO getUserShoppingCart(Long userId);

    /**
     * 删除购物车商品
     * @param delShoppingCartModel
     * @param userId
     * @return
     */
    int delUserShoppingCart(DelShoppingCartModel delShoppingCartModel, Long userId);

}
